<template>
	<view class="selection">
		<view class="box1">
			<uni-nav-bar  left-icon="left" fixed class="custom-nav-bar"  title="" :status-bar="true" :background-color="scrollDistance>50?'#fff':'#00000000'" color="#000" :border='false'>
			</uni-nav-bar>
			<view class="classification">
				
				<view class="">
					<text class="dis">按商品</text>
					<view class="">
						
					</view>
				</view>
				<view class="">
					<text>按供应商</text>
					<view class="dis">
						
					</view>
				</view>
			</view>
			<view class="">
				<view class="">
					<image :src="imageUrl + 'classification1.png'" mode=""></image>
					<text>食品生鲜</text>
				</view>
				<view class="">
					<image :src="imageUrl + 'classification2.png'" mode=""></image>
					<text>食品生鲜</text>
				</view>
				<view class="">
					<image :src="imageUrl + 'classification3.png'" mode=""></image>
					<text>食品生鲜</text>
				</view>
				<view class="">
					<image :src="imageUrl + 'classification4.png'" mode=""></image>
					<text>食品生鲜</text>
				</view>
				<view class="" @click="opens">
					<image :src="imageUrl + 'classification5.png'" mode=""></image>
					<text>食品生鲜</text>
				</view>
			</view>
			<view class="">
				<view class="">
					<view class="">
						热销商品
					</view>
					<text>
						快速爆单
					</text>
					<view class="">
						<image :src="imageUrl + 'classification6.png'" mode=""></image>
					</view>
				</view>
				<view class="">
					<view class="">
						高佣商品
					</view>
					<text>
						提升收入
					</text>
					<view class="">
						<image :src="imageUrl + 'classification7.png'" mode=""></image>
					</view>
				</view>
				<view class="">
					<view class="">
						同行跟选
					</view>
					<text>
						参考选品
					</text>
					<view class="">
						<image :src="imageUrl + 'classification8.png'" mode=""></image>
					</view>
				</view>
			</view>
			<view class="filter">
				<view class="dis">推荐</view>
				<view>高佣金</view>
				<view>热销</view>
				<view>价格</view>
			</view>
			<view class="list">
				<view class="" v-for="item in 10">
					<image src="/static/logo.png" mode=""></image>
					<view class="">
						<view class="">
							诗泊雅女家用梳樱花粉蓬松排骨梳高颅顶排骨梳子大弯发梳按摩...
						</view>
						<text>
							CC日用小店
						</text>
						<view class="">
							<view class="">
								<view class="">
									赚 ￥<text>4.95</text>
								</view>
								<view class="">
									售价￥9.9 佣金率50%
								</view>
							</view>
							<view class="">
								加橱窗
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
	<uni-popup ref="popup" type="bottom" background-color="#fff" borderRadius="10px 10px 0 0">
		<view class="allfilter">
			<text>选择品类</text>
			<view class="">
				<view class="" v-for="(item,index) in 9" :class="index == 1?'dis':''">
					全部
				</view>
			</view>
		</view>
	</uni-popup>
</template>

<script setup>
	import { ref, getCurrentInstance } from 'vue';
	import { onPageScroll } from '@dcloudio/uni-app';
	const scrollDistance = ref(0);
	const { appContext } = getCurrentInstance();
	const imageUrl = appContext.config.globalProperties.$imageUrl
	onPageScroll((e) => {
	    scrollDistance.value = e.scrollTop;
	});
	let popup = ref('')
	const opens = ()=>{
			popup.value.open()
	}
</script>

<style lang="scss" scoped>
	.selection{
		min-height: 100vh;
		background: rgb(246, 247, 248);
	}
	.box1{
		width: 100%;
		height: 400rpx;
		padding-bottom: 36rpx;
		background-image: url('http://mdomall.oss-cn-hangzhou.aliyuncs.com/static/bg4.png');
		background-repeat: no-repeat;
		background-size: 100% 100%;
		.classification{
			display: flex;
			align-items:center;
			padding: 0  33rpx;
			margin-bottom: 36rpx;
			padding-top: 20rpx;
			>view{
				display: flex;
				flex-direction: column;
				align-items: center;
				margin-right: 80rpx;
				text{
					font-size: 32rpx;
					font-weight: 400;
					color: rgba(106, 106, 106, 1);
					padding-bottom: 6rpx;
				}
				>view{
					width: 40rpx;
					height: 6rpx;
					border-radius: 6rpx;
					background-color: rgba(252, 80, 0, 1);
					margin-top: 6rpx;
				}
				.dis{
					background-color: rgba(252, 80, 0, 0);
				}
			}
		}
		>view:nth-child(3){
			display: flex;
			align-items:center;
			justify-content:space-between;
			padding: 0 33rpx;
			box-sizing: border-box;
			margin-bottom: 36rpx;
			>view{
				display: flex;
				flex-direction: column;
				align-items: center;
				image{
					width: 76rpx;
					height: 76rpx;
					margin-bottom: 15rpx;
				}
				text{
					font-size: 24rpx;
					font-weight: 500;
					color: rgba(42, 42, 42, 1);
				}
			}
		}
		>view:nth-child(4){
			display: flex;
			align-items:center;
			justify-content:space-between;
			padding: 0 33rpx;
			box-sizing: border-box;
			>view:nth-child(1){
				background: rgba(255, 235, 217, 1);
			}
			>view:nth-child(2){
				background: rgba(255, 224, 224, 1);
			}
			>view:nth-child(3){
				background: rgba(224, 239, 255, 1);
			}
			>view{
				display: inline-block;
				padding: 22rpx 24rpx;
				width: 215rpx;
				height: 199rpx;
				border-radius: 12rpx;
				box-sizing: border-box;
				>view:nth-child(1){
					font-size: 28rpx;
					font-weight: 700;
					color: rgba(42, 42, 42, 1);
				}
				text{
					font-size: 24rpx;
					color: rgba(153, 153, 153, 1);
				}
				>view:nth-child(3){
					display: flex;
					justify-content: flex-end;
					image{
						width: 100rpx;
						height: 100rpx;
						transform: translateY(-10rpx);
					}
				}
			}
		}
		.filter{
			display: flex;
			align-items:center;
			padding: 0 33rpx;
			box-sizing: border-box;
			margin-top: 36rpx;
			>view{
				margin-right: 56rpx;
				font-size: 28rpx;
				font-weight: 400;
				color: rgba(106, 106, 106, 1);

			}
			.dis{
				font-size: 28rpx;
				font-weight: 700;
				color: rgba(42, 42, 42, 1);

			}
		}
		.list{
			padding: 0 33rpx;
			padding-top: 10rpx;
			>view{
				display: flex;
				padding: 32rpx 0;
				border-bottom: 1px solid rgba(238, 238, 238, 1);
				image{
					width: 240rpx;
					height: 240rpx;
					flex-shrink: 0;
					margin-right: 16rpx;
				}
				>view{
					display: flex;
					flex-direction: column;
					justify-content: space-between;
					>view:nth-child(1){
						font-size: 28rpx;
						font-weight: 700;
						color: rgba(42, 42, 42, 1);
					}
					>text{
						font-size: 24rpx;
						color: rgba(106, 106, 106, 1);
					}
					>view:nth-child(3){
						display: flex;
						align-items: flex-end;
						justify-content: space-between;
						>view:nth-child(1){
							>view:nth-child(1){
								font-size: 24rpx;
								font-weight: 700;
								color: rgba(252, 80, 0, 1);
								text{
									/** 文本3 */
									font-size: 36rpx;
									font-weight: 700;
									color: rgba(252, 80, 0, 1);
								}
							}
							>view:nth-child(2){
								font-size: 24rpx;
								color: rgba(106, 106, 106, 1);
							}
						}
						>view:nth-child(2){
							font-size: 28rpx;
							font-weight: 700;
							color: rgba(255, 255, 255, 1);
							border-radius: 80rpx;
							background: rgba(255, 127, 6, 1);
							padding: 11rpx 38rpx;
						}
					}
				}
			}
		}
	}
	.allfilter{
		padding: 40rpx;
		box-sizing: border-box;
		>text{
			font-size: 28rpx;
			font-weight: 500;
			margin-bottom: 40rpx;
			display: block;
			text-align: center;
		}
		>view{
			display: flex;
			align-items: start;
			flex-wrap: wrap;
			justify-content: space-between;
			>view{
				width: 212rpx;
				height: 120rpx;
				opacity: 1;
				border-radius: 8rpx;
				background: rgba(242, 242, 242, 1);
				display: flex;
				align-items:center;
				justify-content:center;
				margin-bottom: 12rpx;
			}
			.dis{
				background: rgba(255, 127, 6, 1);
				color: #fff;
			}
		}
	}
</style>